package kit.docker.exception;

import com.jfinal.upload.UploadFile;
import kit.docker.file.FileKit;

import java.util.List;

/**
 * @author ldl
 * @date 2020/10/26 14:07
 */
public class UploadException extends BaseException {

    private List<UploadFile> files;

    private UploadFile file;

    public UploadException(List<UploadFile> files) {
        this.files = files;
        FileKit.deleteFile(files);
    }

    public UploadException(UploadFile file) {
        this.file = file;
        FileKit.deleteFile(file);
    }

    public UploadException(List<UploadFile> files, String message) {
        this.files = files;
        this.message = message;
        FileKit.deleteFile(files);
    }

    public UploadException(UploadFile file, String message) {
        this.file = file;
        this.message = message;
        FileKit.deleteFile(file);
    }

    public List<UploadFile> getFiles() {
        return files;
    }

    public void setFiles(List<UploadFile> files) {
        this.files = files;
    }

    public UploadFile getFile() {
        return file;
    }

    public void setFile(UploadFile file) {
        this.file = file;
    }

}
